<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge" >
  <title>谷歌云搭建免费VPN(二) | Grx Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="整体大概流程：申请免费谷歌云服务 =&amp;gt; 创建虚拟实例 =&amp;gt; 在实例搭建SSR或L2TP/IPsecVPN 服务">
<meta property="og:type" content="article">
<meta property="og:title" content="谷歌云搭建免费VPN(二)">
<meta property="og:url" content="http://yoursite.com/2019/07/13/谷歌云搭建免费VPN(二)/index.html">
<meta property="og:site_name" content="Grx Blog">
<meta property="og:description" content="整体大概流程：申请免费谷歌云服务 =&amp;gt; 创建虚拟实例 =&amp;gt; 在实例搭建SSR或L2TP/IPsecVPN 服务">
<meta property="og:image" content="https://static.oschina.net/uploads/space/2017/1224/010450_QY0n_924639.png">
<meta property="og:image" content="https://static.oschina.net/uploads/space/2017/1224/010600_PsvG_924639.png">
<meta property="og:image" content="https://static.oschina.net/uploads/space/2017/1224/010728_pEhQ_924639.png">
<meta property="og:image" content="https://static.oschina.net/uploads/space/2017/1224/004435_Dgcy_924639.png">
<meta property="og:image" content="https://static.oschina.net/uploads/space/2017/1224/004459_hZxc_924639.png">
<meta property="og:image" content="https://static.oschina.net/uploads/space/2017/1224/005455_3vfp_924639.png">
<meta property="og:updated_time" content="2019-07-15T03:41:45.820Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="谷歌云搭建免费VPN(二)">
<meta name="twitter:description" content="整体大概流程：申请免费谷歌云服务 =&amp;gt; 创建虚拟实例 =&amp;gt; 在实例搭建SSR或L2TP/IPsecVPN 服务">
<meta name="twitter:image" content="https://static.oschina.net/uploads/space/2017/1224/010450_QY0n_924639.png">
  
    <link rel="alternative" href="/atom.xml" title="Grx Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="/img/rufei.jpg" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/">Grx</a></h1>
		</hgroup>

		
		<p class="header-subtitle">自我管理，知识管理，时间管理，阅读，语音写作，思维导图</p>
		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						<div class="icon-wrap icon-link hide" data-idx="2">
							<div class="loopback_l"></div>
							<div class="loopback_r"></div>
						</div>
						
						
						<div class="icon-wrap icon-me hide" data-idx="3">
							<div class="user"></div>
							<div class="shoulder"></div>
						</div>
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						<li>友情链接</li>
						
						
						<li>关于我</li>
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/tags/life">随笔</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
								<a class="github" target="_blank" href="https://github.com/ruixiaoguo" title="github">github</a>
					        
								<a class="weibo" target="_blank" href="https://weibo.com/u/3984935859?refer_flag=1005055010_" title="weibo">weibo</a>
					        
								<a class="rss" target="_blank" href="#" title="rss">rss</a>
					        
								<a class="zhihu" target="_blank" href="#" title="zhihu">zhihu</a>
					        
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						<a href="/tags/OC/" style="font-size: 10px;">-OC</a> <a href="/tags/Android/" style="font-size: 10px;">Android</a> <a href="/tags/Apple-Watch/" style="font-size: 10px;">Apple Watch</a> <a href="/tags/Flutter/" style="font-size: 13.33px;">Flutter</a> <a href="/tags/Life/" style="font-size: 10px;">Life</a> <a href="/tags/Lottie/" style="font-size: 10px;">Lottie</a> <a href="/tags/MMKV/" style="font-size: 10px;">MMKV</a> <a href="/tags/MonkeyKing/" style="font-size: 10px;">MonkeyKing</a> <a href="/tags/OC/" style="font-size: 20px;">OC</a> <a href="/tags/RAC/" style="font-size: 11.67px;">RAC</a> <a href="/tags/Swift/" style="font-size: 15px;">Swift</a> <a href="/tags/WKWebView/" style="font-size: 10px;">WKWebView</a> <a href="/tags/WebView/" style="font-size: 10px;">WebView</a> <a href="/tags/Xcode/" style="font-size: 18.33px;">Xcode</a> <a href="/tags/appledoc/" style="font-size: 10px;">appledoc</a> <a href="/tags/hexo/" style="font-size: 11.67px;">hexo</a> <a href="/tags/ios/" style="font-size: 10px;">ios</a> <a href="/tags/life/" style="font-size: 16.67px;">life</a> <a href="/tags/xcode/" style="font-size: 10px;">xcode</a>
					</div>
				</section>
				
				
				
				<section class="switch-part switch-part3">
					<div id="js-friends">
					
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://blog.devtang.com">唐巧的博客</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://beyondvincent.com">破船之家</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://limboy.me">无网不剩</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://msching.github.io">码农人生</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://yulingtianxia.com">玉令天下</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://blog.leichunfeng.com">雷纯锋的技术博客</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://jax.cnblogs.com">包建强</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://blog.cnbang.net">bang</a>
			        
			        </div>
				</section>
				

				
				
				<section class="switch-part switch-part4">
				
					<div id="js-aboutme">知识管理，时间管理，自我管理，阅读，语音写作，思维导图，Wiz，TimeMeter</div>
				</section>
				
			</div>
		</div>
	</header>				
</div>

    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide">Grx</h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
			
				<img lazy-src="/img/rufei.jpg" class="js-avatar">
			
			</div>
			<hgroup>
			  <h1 class="header-author">Grx</h1>
			</hgroup>
			
			<p class="header-subtitle">自我管理，知识管理，时间管理，阅读，语音写作，思维导图</p>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/tags/life">随笔</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/ruixiaoguo" title="github">github</a>
			        
						<a class="weibo" target="_blank" href="https://weibo.com/u/3984935859?refer_flag=1005055010_" title="weibo">weibo</a>
			        
						<a class="rss" target="_blank" href="#" title="rss">rss</a>
			        
						<a class="zhihu" target="_blank" href="#" title="zhihu">zhihu</a>
			        
				</div>
			</nav>
		</header>				
	</div>
</nav>

      <div class="body-wrap"><article id="post-谷歌云搭建免费VPN(二)" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/07/13/谷歌云搭建免费VPN(二)/" class="article-date">
  	<time datetime="2019-07-13T09:28:47.000Z" itemprop="datePublished">2019-07-13</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      谷歌云搭建免费VPN(二)
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Xcode/">Xcode</a></li></ul>
	</div>

        

        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <blockquote>
<h4 id="整体大概流程：申请免费谷歌云服务-gt-创建虚拟实例-gt-在实例搭建SSR或L2TP-IPsecVPN-服务"><a href="#整体大概流程：申请免费谷歌云服务-gt-创建虚拟实例-gt-在实例搭建SSR或L2TP-IPsecVPN-服务" class="headerlink" title="整体大概流程：申请免费谷歌云服务 =&gt; 创建虚拟实例 =&gt; 在实例搭建SSR或L2TP/IPsecVPN 服务"></a>整体大概流程：申请免费谷歌云服务 =&gt; 创建虚拟实例 =&gt; 在实例搭建SSR或L2TP/IPsecVPN 服务</h4></blockquote>
<a id="more"></a>
<h2 id="一-修改防火墙："><a href="#一-修改防火墙：" class="headerlink" title="一.   修改防火墙："></a>一.   修改防火墙：</h2><blockquote>
<p>VPC网络 -&gt; 防火墙规则 -&gt; <a href="https://console.cloud.google.com/networking/firewalls/list" target="_blank" rel="external">创建防火墙</a>注意以下几点即可：</p>
</blockquote>
<ul>
<li>目标：网络中所有的实例</li>
<li>来源过滤：IP地址范围，并设置为0.0.0.0/0</li>
<li>协议和端口：全部允许</li>
</ul>
<p><img src="https://static.oschina.net/uploads/space/2017/1224/010450_QY0n_924639.png" alt="avatar"></p>
<h2 id="二-申请静态IP："><a href="#二-申请静态IP：" class="headerlink" title="二. 申请静态IP："></a>二. 申请静态IP：</h2><blockquote>
<p>若长期使用，建议还是申请一个<br>VPC网络 -&gt; 外部IP地址 -&gt; <a href="https://console.cloud.google.com/networking/addresses/list" target="_blank" rel="external">保留静态地址（即添加）</a>注意以下几点即可:</p>
</blockquote>
<ul>
<li>区域：asia-east1</li>
</ul>
<p><img src="https://static.oschina.net/uploads/space/2017/1224/010600_PsvG_924639.png" alt="avatar"></p>
<h2 id="三-创建计算引擎"><a href="#三-创建计算引擎" class="headerlink" title="三.创建计算引擎"></a>三.创建计算引擎</h2><blockquote>
<p>Computer Engine -&gt; VM实例 -&gt; <a href="https://console.cloud.google.com/compute/instances" target="_blank" rel="external">创建实例</a>注意以下几点即可:</p>
</blockquote>
<ul>
<li>地区：asia-east1-b</li>
<li>机器类型：微型，1个共享vCPU（0.6GB内存）</li>
<li>管理、磁盘、网络、SSH 密钥：打开，选择网络，选择之前申请的静态IP</li>
</ul>
<p><img src="https://static.oschina.net/uploads/space/2017/1224/010728_pEhQ_924639.png" alt="avatar"></p>
<p><img src="https://static.oschina.net/uploads/space/2017/1224/004435_Dgcy_924639.png" alt="avatar"></p>
<h4 id="待实例创建完成以后，服务器的搭建就完成了，现在需要通过SSH连接到服务器，安装软件了。其实很简单，只需要粘贴几行代码即可。"><a href="#待实例创建完成以后，服务器的搭建就完成了，现在需要通过SSH连接到服务器，安装软件了。其实很简单，只需要粘贴几行代码即可。" class="headerlink" title="待实例创建完成以后，服务器的搭建就完成了，现在需要通过SSH连接到服务器，安装软件了。其实很简单，只需要粘贴几行代码即可。"></a>待实例创建完成以后，服务器的搭建就完成了，现在需要通过SSH连接到服务器，安装软件了。其实很简单，只需要粘贴几行代码即可。</h4><h2 id="四-服务端安装ShadowsocksR"><a href="#四-服务端安装ShadowsocksR" class="headerlink" title="四.服务端安装ShadowsocksR"></a>四.服务端安装ShadowsocksR</h2><h4 id="1-通过SSH连接到服务器"><a href="#1-通过SSH连接到服务器" class="headerlink" title="1. 通过SSH连接到服务器"></a>1. 通过SSH连接到服务器</h4><p><img src="https://static.oschina.net/uploads/space/2017/1224/004459_hZxc_924639.png" alt="avatar"></p>
<h4 id="2-依次复制以下命令，粘贴到命令行执行即可"><a href="#2-依次复制以下命令，粘贴到命令行执行即可" class="headerlink" title="2. 依次复制以下命令，粘贴到命令行执行即可"></a>2. 依次复制以下命令，粘贴到命令行执行即可</h4><ul>
<li>输入命令:<br> sudo -s</li>
<li>安装wget <br>yum -y install wget</li>
<li>下载ShadowsocksR:<br>wget –no-check-certificate <a href="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh" target="_blank" rel="external">https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh</a></li>
<li>增加执行权限:<br>chmod +x shadowsocksR.sh</li>
<li>安装并写入日志:<br>./shadowsocksR.sh 2&gt;&amp;1 | tee shadowsocksR.log</li>
</ul>
<blockquote>
<p>注意以下几点:</p>
</blockquote>
<ol>
<li>安装途中首先会提示需要输入ss的连接密码，不推荐留空（如果留空回车，密码则是提示里的teddysun.com）</li>
<li>当安装完成，会在页面显示IP, Password, Protocol等信息，需要全部保存。</li>
</ol>
<h4 id="3-安装完成！"><a href="#3-安装完成！" class="headerlink" title="3.安装完成！"></a>3.安装完成！</h4><h4 id="此时我们已经有了一个ss服务器，可如何让我们的电脑，手机端通过这个ss服务器上网"><a href="#此时我们已经有了一个ss服务器，可如何让我们的电脑，手机端通过这个ss服务器上网" class="headerlink" title="此时我们已经有了一个ss服务器，可如何让我们的电脑，手机端通过这个ss服务器上网?"></a>此时我们已经有了一个ss服务器，可如何让我们的电脑，手机端通过这个ss服务器上网?</h4><h2 id="五-mac连接ss服务器上网"><a href="#五-mac连接ss服务器上网" class="headerlink" title="五.mac连接ss服务器上网"></a>五.mac连接ss服务器上网</h2><h4 id="1-在mac电脑上下载ss客户端"><a href="#1-在mac电脑上下载ss客户端" class="headerlink" title="1. 在mac电脑上下载ss客户端"></a>1. 在mac电脑上下载ss客户端</h4><h4 id="下载地址-https-github-com-shadowsocks-shadowsocks-iOS-releases-download-2-6-3-ShadowsocksX-2-6-3-dmg"><a href="#下载地址-https-github-com-shadowsocks-shadowsocks-iOS-releases-download-2-6-3-ShadowsocksX-2-6-3-dmg" class="headerlink" title="下载地址:https://github.com/shadowsocks/shadowsocks-iOS/releases/download/2.6.3/ShadowsocksX-2.6.3.dmg"></a>下载地址:<a href="https://github.com/shadowsocks/shadowsocks-iOS/releases/download/2.6.3/ShadowsocksX-2.6.3.dmg" target="_blank" rel="external">https://github.com/shadowsocks/shadowsocks-iOS/releases/download/2.6.3/ShadowsocksX-2.6.3.dmg</a></h4><h4 id="2-在客户端添加ss服务器信息"><a href="#2-在客户端添加ss服务器信息" class="headerlink" title="2.在客户端添加ss服务器信息"></a>2.在客户端添加ss服务器信息</h4><h4 id="安装好以后打开软件，添加一个服务器，信息照着之前的输入即可"><a href="#安装好以后打开软件，添加一个服务器，信息照着之前的输入即可" class="headerlink" title="安装好以后打开软件，添加一个服务器，信息照着之前的输入即可"></a>安装好以后打开软件，添加一个服务器，信息照着之前的输入即可</h4><p><img src="https://static.oschina.net/uploads/space/2017/1224/005455_3vfp_924639.png" alt="avatar"></p>
<h4 id="3-大功告成"><a href="#3-大功告成" class="headerlink" title="3.大功告成!!!"></a>3.大功告成!!!</h4>
      
    </div>
    
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/07/19/构建 NetworkExtension 应用（一）/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption"><</strong>
      <div class="article-nav-title">
        
          构建 NetworkExtension 应用（一）
        
      </div>
    </a>
  
  
    <a href="/2019/07/13/谷歌云搭建免费VPN(一)/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">谷歌云搭建免费VPN(一)</div>
      <strong class="article-nav-caption">></strong>
    </a>
  
</nav>

  
</article>


<div class="share_jia">
	<!-- JiaThis Button BEGIN -->
	<div class="jiathis_style">
		<span class="jiathis_txt">Share to: &nbsp; </span>
		<a class="jiathis_button_facebook"></a> 
    <a class="jiathis_button_twitter"></a>
    <a class="jiathis_button_plus"></a> 
    <a class="jiathis_button_tsina"></a>
		<a class="jiathis_button_cqq"></a>
		<a class="jiathis_button_douban"></a>
		<a class="jiathis_button_weixin"></a>
		<a class="jiathis_button_tumblr"></a>
    <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	</div>
	<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=1405949716054953" charset="utf-8"></script>
	<!-- JiaThis Button END -->
</div>






<div class="duoshuo">
	<!-- 多说评论框 start -->
	<div class="ds-thread" data-thread-key="谷歌云搭建免费VPN(二)" data-title="谷歌云搭建免费VPN(二)" data-url="http://yoursite.com/2019/07/13/谷歌云搭建免费VPN(二)/"></div>
	<!-- 多说评论框 end -->
	<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
	<script type="text/javascript">
	var duoshuoQuery = {short_name:"true"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
	<!-- 多说公共JS代码 end -->
</div>




</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
    	<div class="footer-left">
    		&copy; 2019 Grx
    	</div>
      	<div class="footer-right">
      		<a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
      	</div>
    </div>
  </div>
</footer>
    </div>
    
  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">


<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>
<script src="/js/main.js"></script>






<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  </div>
</body>
</html>